<?php 
include_once('../public/head.php');
$config = include_once('../../public/config.php');
include_once('../../public/function.php');
$result =select($config,'lanmu');


$_POST['ctime'] = time();
 
if (isset($_GET['keywords']) &&$_GET['keywords'] !='') {
   $where= "where name like '%{$_GET['keywords']}%' ";
}else{
    $where ='';
}

$result =select($config,'lanmu',$where);
 ?>

<!--/sidebar-->
    <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="../index.php">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">栏目管理</span></div>
        </div>
        <div class="search-wrap">
            <div class="search-content">
                <form action="lanmu.php" method="getS">
                    <table class="search-tab">
                        <tr>
                            
                            <th width="70">关键字:</th>
                            <td><input class="common-text" placeholder="关键字" name="keywords" value="" id="" type="text"></td>
                            <td><input class="btn btn-primary btn2 value="查询" type="submit"></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="result-wrap">
            <form name="myform" id="myform" method="post">
                <div class="result-title">
                    <div class="result-list">
                        <a href="./add.php"><i class="icon-font"></i>新增栏目</a>
                        <a id="batchDel" href="javascript:void(0)"><i class="icon-font"></i>批量删除</a>
                        <a id="updateOrd" href="javascript:void(0)"><i class="icon-font"></i>更新排序</a>
                    </div>
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th class="tc" width="5%"><input class="allChoose" name="" type="checkbox"></th>
                         
                            <th>ID</th>
                            <th>栏目名称</th>
                            <th>栏目描述</th>
                            <th>状态</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                       <?php 

                            foreach ($result as $v) {
                                echo '<tr>
                                <td></td>
                                <td>'.$v['id'].'</td>
                                <td>'.$v['name'].'</td>
                                <td>'.$v['miaoshu'].'</td>
                                <td>'.($v['status'] =='T'?'正常':'隐藏').'</td>
                                <td>'.date('Y-m-d H:i:s',$v['ctime']).'</td>
                                <td>
                                <a class="link-update" href="update.php?id='.$v["id"].'">修改</a>
                                <a class="link-del" href="del.php?id='.$v["id"].'">删除</a>
                                </td>
                        
                                <tr>';

                            }



                        ?>
                    </table>
                     <div class="list-page"> 2 条 1/1 页
                    <a href=""> 上一页</a>
                    <a href=""> 下一页</a>

                    <input class="common-text" placeholder="第几页" name="keywords" value="" id="" type="text"></td>
                            <td><input class="btn btn-primary btn2" name="sub" value="跳到" type="submit">
                    </div>
                </div>
            </form>
        </div>
    </div>
    <!--/main-->




<?php 
include_once("../public/end.php")
 ?>
